#Wireshark nhns protocol dissector

PROJECT_PATH= /home/malo/n-hack-n-slash/WiresharkDissector
INSTALL_PATH= /usr/lib/wireshark/plugins/1.2.15
INCLUDES= -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

.PHONY: all
all: packet-nhns.c
	$(PROJECT_PATH)/tools/make-dissector-reg $(PROJECT_PATH)/plugin.c plugin packet-nhns.c
	gcc -c -g $(INCLUDES) packet-nhns.c -o packet-nhns.c.o
	gcc -c -g $(INCLUDES) plugin.c -o plugin.c.o
	gcc -fPIC -g3 -gdwarf-2 -shared -Wl,-soname,nhns.so -o nhns.so plugin.c.o packet-nhns.c.o -lwireshark
	rm -f $(INSTALL_PATH)/nhns.so
	cp nhns.so $(INSTALL_PATH)
